using System.ComponentModel.DataAnnotations;

namespace EIMS.Models.AccountViewModels
{
    public class RegisterViewModel
    {
        [Required(ErrorMessage = "用户名不能为空")]
        [Display(Name = "用户名")]
        public string Username { get; set; }

        [Required(ErrorMessage = "显示名称不能为空")]
        [Display(Name = "显示名称")]
        [StringLength(50, ErrorMessage = "{0}的长度必须在{2}到{1}个字符之间。", MinimumLength = 2)]
        public string DisplayName { get; set; }

        [Required(ErrorMessage = "邮箱不能为空")]
        [EmailAddress(ErrorMessage = "邮箱格式不正确")]
        [Display(Name = "邮箱")]
        public string Email { get; set; }

        [Required(ErrorMessage = "密码不能为空")]
        [StringLength(100, ErrorMessage = "{0}的长度必须在{2}到{1}个字符之间。", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "密码")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "确认密码")]
        [Compare("Password", ErrorMessage = "两次输入的密码不一致")]
        public string ConfirmPassword { get; set; }
    }
} 